﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.security.cert.X509Certificate"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>

<body>
<%
			X509Certificate[] certs = (X509Certificate[]) request
					.getAttribute("javax.servlet.request.X509Certificate");
			if (certs == null) {
				out.println("请确认是否插入了数字证书!");
				return;
			}
			X509Certificate gaX509Cert = null;
			gaX509Cert = certs[0]; //获取序列号
			String sn = gaX509Cert.getSerialNumber().toString(16);
			String tempDN = gaX509Cert.getSubjectDN().toString(); //pki 正式使用
			String dn[] = tempDN.split(",");
			String sid = dn[0].substring(dn[0].indexOf(" ") + 1);
			out.print(sid);
			System.out.println(sid);
		%>

		<script type="text/javascript">
		   window.location='http://10.128.131.92:7001/oa/loginCert.action?name='+'<%=sid%>';
		</script>
</body>
</html>